package com.jt.deepSeaMain;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jt.config.TimingConfig;
import com.jt.dto.CollectParamsDto;
import com.jt.mapper.TimingMapper;
import com.jt.pojo.Timing;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.io.IOException;
import java.util.List;

@Component
@Slf4j
public class failTask extends TimingConfig {

    @Autowired
    private TimingMapper timingMapper;

    @Override
    protected Boolean getSwitch() {
        return false;
    }

    @Override
    protected void processTask() throws IOException {
        log.info(">>>>>定时扫描Timing表开始");
        List<Timing> timingList = timingMapper.selectList(new QueryWrapper<Timing>().ne("state", "1"));
        timingList.forEach(item -> {
            if (item.getType().equals("face")) {
                CollectParamsDto collectParamsDto=new CollectParamsDto();

            }
        });

    }

    @Override
    protected String getCron() {
        return "0 0/1 * * * ?";
    }
}
